From: Florian Müllner Date: Fri, 13 Aug 2021 01:21:47 +0000 (+0200) Subject: iconGrid: Bail out when not on a monitor X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~574^2^2~126 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=4b4d422c1e865d5f2dac2b6e94e9939bbb7301e8;p=gnome-shell.git iconGrid: Bail out when not on a monitor There shouldn't be any code that calls zoomOutActor() without a monitor, but throwing in an early return doesn't hurt. CID 351285. Part-of: --- diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js index efc638913..65b130ce7 100644 --- a/js/ui/iconGrid.js +++ b/js/ui/iconGrid.js @@ -193,6 +193,10 @@ function zoomOutActor(actor) { } function zoomOutActorAtPos(actor, x, y) { + const monitor = Main.layoutManager.findMonitorForActor(actor); + if (!monitor) + return; + const actorClone = new Clutter.Clone({ source: actor, reactive: false, @@ -207,7 +211,6 @@ function zoomOutActorAtPos(actor, x, y) { Main.uiGroup.add_actor(actorClone); // Avoid monitor edges to not zoom outside the current monitor - let monitor = Main.layoutManager.findMonitorForActor(actor); let scaledWidth = width * APPICON_ANIMATION_OUT_SCALE; let scaledHeight = height * APPICON_ANIMATION_OUT_SCALE; let scaledX = x - (scaledWidth - width) / 2;